import request from '@/utils/request'

/**
 * @description: 获取下拉员工数据
 * @param {*}
 * @return {*}
 */
export function getEmployeeSimple() {
  return request({
    url: '/api/sys/user/simple',
    method: 'get'
  })
}
export function getEmployeeList(page, size) {
  return request({
    methods: 'get',
    url: '/api/sys/user',
    params: { page, size }
  })
}
export function delEmployee(id) {
  return request({
    method: 'delete',
    url: `/api/sys/user/${id}`
  })
}
export function addEmployee(data) {
  return request({
    method: 'post',
    url: '/api/sys/user',
    data
  })
}
export function importEmployees(data) {
  return request({
    method: 'POST',
    url: '/api/sys/user/batch',
    data
  })
}
export function saveUserDetailById(data) {
  return request({
    url: `/api/sys/user/${data.id}`,
    method: 'put', // 全量修改
    data
  })
}
export function assignRoles(data) {
  return request({
    url: '/api/sys/user/assignRoles',
    data,
    method: 'put'
  })
}
